#include <iostream>

using namespace std;

struct ListNode {
    int val;
    ListNode *next;
    ListNode(int x) : val(x), next(NULL) {}
};

bool hasCycle(ListNode *head){

    ListNode* s = head;
    ListNode* f = head;

    while(f && f->next){
        s = s->next;
        f = f->next->next;
        if(s == f) return true;
    }
    return false;
}


int main(){
    cout << "hello world" << endl;
}